<template>
  <div class="index">
    <swiperComponent :func="list"></swiperComponent>
    
    <yd-grids-group :rows="3" >
        <yd-grids-item v-for="(item,i) in claList" :key="i">
          <img slot="icon" src="https://s01.mifile.cn/favicon.ico">
            <span slot="text">{{item.title}}</span>
        </yd-grids-item>
    </yd-grids-group>
  
      <img src="http:////i1.mifile.cn/a4/xmad_1550542672697_mBLbo.jpg" alt="不存在" class="tou">
    
    <!-- 商品 -->
    <yd-list theme="3"> 
        <yd-list-item v-for="(item, key) in shopList" :key="key" @click.native="getInfo(key)">
            <img slot="img" :src="item.img">
            <span slot="title">{{item.title}}</span>
            <yd-list-other slot="other">
                <div>
                    <span class="demo-list-price"><em>¥</em>{{item.price}}</span>
                    <span class="demo-list-del-price">¥{{item.w_price}}</span>
                </div>
                <div>content</div>
            </yd-list-other>
        </yd-list-item>
    </yd-list>
   
  </div>
</template>

<script>
import swiperComponent from '../pulic/swiper.vue'
export default {
  name: 'HelloWorld',
 
  data () {
    return {
      list:[
        { id:"0", url:"http://i1.mifile.cn/a4/xmad_15505619785671_xEXmZ.jpg",href:"http://www.ydcss.com"},
        { id:"1", url:"http://i1.mifile.cn/a4/xmad_15501988704797_QALiV.jpg",href:"http://www.ydcss.com"},
        { id:"2", url:"//i1.mifile.cn/a4/xmad_15489036241498_XVwut.jpg",href:"http://www.ydcss.com"}
      ],
      claList:[
        {title:"小米"},
        {title:"华为"},
        {title:"苹果"},
        {title:"面条"},
        {title:"魅族"},
        {title:"吃饭"}
      ],
      shopList: [
                    
                    {img: "//i1.mifile.cn/a1/pms_1545457703.71734471!220x220.png", title: "标题111标题标题标题标题", price: 2156.23, w_price: 89.36},
                    {img: "//i1.mifile.cn/a1/pms_1537323963.1278763!220x220.jpg", title: "标题222标题标题标题标题", price: 1156.23, w_price: 89.36},
                    {img: "//i1.mifile.cn/a1/pms_1524621350.77238418!220x220.jpg", title: "标题333标题标题标题标题", price: 1356.23, w_price: 89.36},
                    {img: "//i1.mifile.cn/a1/pms_1531878001.22998509!220x220.jpg", title: "标题444标题标题标题标题", price: 1456.23, w_price: 89.36},
                    {img: "//img1.shikee.com/try/2016/06/26/12365720933909085511.jpg", title: "标题555标题标题标题标题", price: 556.23, w_price: 89.36},
                    {img: "//img1.shikee.com/try/2016/06/19/09430120929215230041.jpg", title: "标题666标题标题标题标题", price: 656.23, w_price: 89.36},
                    {img: "//img1.shikee.com/try/2016/06/23/14381920926024616259.jpg", title: "标题777标题标题标题标题", price: 156.23, w_price: 89.36},
                    {img: "//img1.shikee.com/try/2016/06/21/10172020923917672923.jpg", title: "标题888标题标题标题标题", price: 256.23, w_price: 89.36},
                    {img: "//img1.shikee.com/try/2016/06/23/15395220917905380014.jpg", title: "标题999标题标题标题标题", price: 356.23, w_price: 89.36},
                    {img: "//img1.shikee.com/try/2016/06/25/14244120933639105658.jpg", title: "标题1000标题标题标题标题", price: 456.23, w_price: 89.36},
                    {img: "//img1.shikee.com/try/2016/06/26/12365720933909085511.jpg", title: "标题1111标题标题标题标题", price: 556.23, w_price: 89.36},
                    {img: "//img1.shikee.com/try/2016/06/19/09430120929215230041.jpg", title: "标题2222标题标题标题标题", price: 656.23, w_price: 89.36}
                ]

      
    }
  },
  created(){
   var name={age:12}
   this.$http.get({
     url: "/index",
     token: this.$utils.encrypt(name)
   },res => {
     //console.log(res)
   })
   //var privatePem = key.exportKey(name+ '-private-pem');
   //console.log(this.$utils.encrypt(name))
  },
  methods: {
    getInfo(ids){
      this.$router.push({name:"info",params:{id:ids}})
    }
  },
  components:{
    swiperComponent
  }
  
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.tou{
  width:100% ;
}
</style>

